'''
Descripttion: 
Author: yubo
Date: 2022-07-08 10:12:27
LastEditTime: 2022-07-08 15:42:32
'''

def handle_list(data) :
    for elem in data:
        print(type(elem), elem)

def handle_dict(data : dict) :
    for k, v in data.items():
        print(k, v)

#data : list[dict1, dict2, dict3]
def handle_embed_dictwithlist(data) :
    for elem in data:
        for k,v in elem.items():
            fstr = "{} = {}, ".format(k, v)
            print(fstr, end = "")
        print("\n")

def handle_dictwithlist_tostr(data) -> str:
    result = ''
    for elem in data:
        for k,v in elem.items():
            fstr = "{} = {}, ".format(k, v)
            result += fstr
        result += '\n'
    return result


'''
if __name__ == '__main__':
    dict1 = {
        "30" : "Stephen",
        "11" : "Klay",
        "3" : "Jordan"
        }

    dict2 = {
        "0" : "Jayson",
        "42" : "Al",
        "7" : "Jaylen"
        }

    list_data = [dict1, dict2]
    
    #handle_embed_dictwithlist(data)
    print(handle_dictwithlist_tostr(list_data))

    
    data = [1, 2, 3, 4, 5]
    handle_list(data)

    dictdata = {
        "30" : "Stephen",
        "11" : "Klay",
        "3" : "Jordan"
    }
    handle_dict(dictdata)
    '''
